<?php echo '<?xml version="1.0" encoding="utf-8"?>' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>GeoGebra Translation Manager</title>
	
	<?php if(APPLICATION_ENV == 'production'): ?>
	<link rel="stylesheet" type="text/css" href="http://www.geogebra.org/css/general.css" />
	<?php else: ?>
	<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl() ?>/css/general.css" />
	<?php endif; ?>
	<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl() ?>/css/translator.css" />
	
	<script type="text/javascript" src="<?php echo $this->baseUrl('scripts/jquery.js') ?>"></script>
	
	<script type="text/javascript">var baseUrl = "<?php echo $this->baseUrl(); ?>";</script>
	<script type="text/javascript" src="<?php echo $this->baseUrl('scripts/general.js') ?>"></script>
	<?php echo $this->headScript() ?>
</head>
<body>

<div id="main">
<h1><a href="http://www.geogebra.org/">GeoGebra<span></span></a></h1>

<ul class="menu" id="mainmenu">
	<li><a href="http://www.geogebra.org">Return to GeoGebra.org</a></li>
	<li class="active"><a href="<?php echo $this->baseUrl() ?>">Translation Manager</a></li>
</ul>

<ul class="menu" id="submenu">
	<li><a href="<?php echo $this->url(array('action' => 'index', 'controller' => 'index'), 'default', true) ?>">Translations</a></li>
	
	<?php if(!$this->user()->isAuthenticated()): ?>
	<li><a href="<?php echo $this->url(array('action' => 'signin', 'controller' => 'user'), 'default', true) ?>">Sign In</a></li>
	<li><a href="<?php echo $this->url(array('action' => 'becometranslator', 'controller' => 'user'), 'default', true) ?>">Become a Translator</a></li>
	<?php else: ?>
	
	<?php if($this->user()->isAdministrator()): ?>
	<li><a href="<?php echo $this->url(array('action' => 'manage', 'controller' => 'user'), 'default', true) ?>">Manage Users</a></li>
	<?php endif; ?>
	
	<li><a href="<?php echo $this->url(array('action' => 'profile', 'controller' => 'user'), 'default', true) ?>">Profile</a></li>	
	
	<li><a href="<?php echo $this->url(array('action' => 'signout', 'controller' => 'user'), 'default', true) ?>">Sign Out</a></li>
	<?php endif; ?>
	
	<li><a href="<?php echo $this->url(array('action' => 'index', 'controller' => 'help'), 'default', true) ?>">Help</a></li>
</ul>

<div style="height: 20px;">&nbsp;</div>

<?php if(!empty($this->messages)): ?>
<ul class="messages">
<?php foreach($this->messages as $message): ?>
	<li><?php echo $message ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if($this->user()->isAuthenticated() && !$this->user()->isTranslator()): ?>
<p>
	<?php if($this->user()->request): ?>
		You have applied to become a translator. Request pending&#0133;
	<?php else: ?> 
		You did not request translation privileges so far. Without translation
		privileges you are not able to perform any translations.
		<a href="<?php echo $this->url(array('action' => 'apply', 'controller' => 'user'), 'default', true) ?>">
		<strong>Become a translator now.</strong>
		</a>
	<?php endif; ?>
</p>
<?php endif; ?>